from django.http import Http404

def staff_required(function):

    def _inner(request, *args, **kwargs):
        if not request.user.is_staff:
            raise Http404
        return function(request, *args, **kwargs)
    return _inner
